var express = require('express');
var router = express.Router();
var book = require('../json/book.json');
/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});

router.get('/api/book', function(req, res, next) {
  res.json({
    msg: '获取成功',
    code: '20000',
    data: book
  });
});

module.exports = router;
